package com.zhanglu.authentication.router;

import org.springframework.web.bind.annotation.*;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhanglu
 */
@RestController
@Slf4j
public class LoginTest {

    @ApiOperation(value = "测试动态权限配置1号接口", notes = "测试动态权限配置1号接口")
    @ApiResponses({@ApiResponse(code = 200, message = "请求成功", response = String.class)})
    @GetMapping("/test/secured/one")
    public String testSecured1(@RequestParam(value = "test", required = false) String test) {
        log.warn("通了,{}", test);
        return "success";
    }

    @ApiOperation(value = "测试动态权限配置1号接口", notes = "测试动态权限配置1号接口")
    @ApiResponses({@ApiResponse(code = 200, message = "请求成功", response = String.class)})
    @PostMapping("/test/secured/one")
    public String testSecured1Post(@RequestBody String test) {
        log.warn("通了,{}", test);
        return "success";
    }

    @ApiOperation(value = "测试动态权限配置2号接口", notes = "测试动态权限配置2号接口")
    @ApiResponses({@ApiResponse(code = 200, message = "请求成功", response = String.class)})
    @GetMapping("/test/secured/two")
    public String testSecured2(@RequestParam(value = "test", required = false) String test) {
        log.warn("通了,{}", test);
        return "success";
    }

    @ApiOperation(value = "测试动态权限配置3号接口", notes = "测试动态权限配置3号接口")
    @ApiResponses({@ApiResponse(code = 200, message = "请求成功", response = String.class)})
    @GetMapping("/test/secured/three")
    public String testSecured3(@RequestParam(value = "test", required = false) String test) {
        log.warn("通了,{}", test);
        return "success";
    }
}
